function getProxy(){
    var obj = new Proxy({},{
        get: function(target,propKey,receiver){
            console.log(`getting ${propKey}!`);
            return Reflect.get(target,propKey,receiver)
        },
        set: function(target,propKey,value,receiver){
            console.log(`setting ${propKey}`);
            return Reflect.set(target,propKey,value,receiver)
        }
    });
    obj.count=1
    ++obj.count
}
//getProxy()
/* 
    拦截对象读取属性行为的例子
*/

function getProxy(){
    var proxy = new Proxy({},{
        get:function(target,propKey,receiver){
            if(propKey === 'name'){
                return 'shuaige'
            }
            return 35
        }
    })
    console.log(proxy.time)
    console.log(proxy.name)
    console.log(proxy.title)
}
getProxy()